package innerclass;

/**
 * 外围类
 *
 * @author sun.ye
 * @since 2020-06-09 22:21
 */
public class Outer {

    private String name;

    public Outer(String name) {
        this.name = name;
    }

    public Inner getInner(){
        return new Inner();
    }


    class Inner{
        public String getOuterName(){
            return name;
        }
    }


    public static void main(String[] args) {
        Inner inner = new Outer("my outer").getInner();
        inner.getOuterName();
        System.out.println(inner.getOuterName());
        Outer outer = new Outer("my outer");
        Inner innerNew = outer.new Inner();
    }
}